package com.car.serivce.integration;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.car.spdier.HashTable;
import com.car.spdier.service.ParseService;
import com.car.spdier.service.dao.entity.Punishment;
import com.car.spdier.service.impl.BaseParseService;
import com.car.spdier.service.impl.ParseServiceFactory;
import com.comm.cache.entity.Punishments;
import com.comm.cache.entity.QueryBase;

/**
 * 
 * PageHttpClient.java类责任：参数检查
 * 
 * @author Administrator
 * 
 */

public class PageHttpClient implements SCarTrafficViolationService {
	public  Punishments  queryViolationByCity(Map map, QueryBase query) {

		List<Punishment> queryDetails = new ArrayList();
		try {
			//检查条件
			Object cityObj = map.get("city");
			if (cityObj == null) {
				// 获取地址为空
				return null;
			}
			Object obj = HashTable.getHashTable().get(cityObj.toString());
			if (obj == null) {
				// 不支持这个地区
				return null;
			}
			ParseService parseService =  ParseServiceFactory.getParseService(cityObj.toString());
			
			//2.处理用户表t_user_base_query
		 
			//3.处理数据		
			return parseService.parseRequest(map,query);

		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
			System.out.print(e1.getStackTrace());
		}

		return null;
	}

	public static void main(String[] args) {
		// 807013910

		/*
		 * String str = "2011-1-27"; DateFormat df = new
		 * SimpleDateFormat("yyyy-MM-dd"); try { Date d = df.parse(str);
		 * System.out.print(d.toLocaleString() ); } catch (ParseException e) { //
		 * TODO Auto-generated catch block e.printStackTrace(); }
		 */

		/*
		 * GetMethod method; //<input type="hidden" name=act value=search> Map
		 * map = new HashMap(); map.put("carNo", "NHS499");//nhs499
		 * map.put("city", "苏"); map.put("type", "02/小型汽车号牌"); map.put("act",
		 * "search"); String url =
		 * "http://www.shjtaq.com/zwfg/dzjc_new.asp?cardqz=苏&carnumber=NHS499&type1=02/小型汽车号牌&act=search";
		 * try { MyHttpClient.getHtmlSourceCode(url); } catch (HttpException e) { //
		 * TODO Auto-generated catch block e.printStackTrace(); } catch
		 * (IOException e) { // TODO Auto-generated catch block
		 * e.printStackTrace(); }
		 */}
	/*
	 * private static String getTag(String pattern, String str) { Pattern sp =
	 * Pattern.compile(pattern); Matcher matcher = sp.matcher(str); while
	 * (matcher.find()) { for (int i = 0; i < matcher.groupCount(); i++) {
	 * System.out.println(" html 正则表达式解析 " + matcher.group(i)); ; } } return ""; }
	 */

}
